﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Collections;

namespace AcctrueWMS.Foundation.Data
{
    public class DataModelRelationCollection : InternalDataCollectionBase
    {
        private DataModel datamodel;
        public DataModel OwnerModel
        {

            get
            {
                return this.datamodel;
            }
            set
            {
                this.datamodel = value;
            }
        }
        public DataModelRelationCollection(DataModel Owner)
        {
            datamodel = Owner;
        }
        public void Add(DataModelRelation dataModelRelation)
        {
            List.Add(dataModelRelation);
        }
        public void Remove(DataModelRelation dataModelRelation)
        {
            List.Remove(dataModelRelation);
        }
        public void RemoveAt(int index)
        {
            List.RemoveAt(index);
        }
        public DataModelRelation this[int index]
        {
            get
            {
                return List[index] as DataModelRelation;
            }
        }
        public void AddRange(DataModelRelation[] dataModelRelations)
        {
            this.List.AddRange(dataModelRelations);
        }
        private ArrayList list;
        protected override System.Collections.ArrayList List
        {
            get
            {
                if (list == null)
                    list = new ArrayList();
                return list;
            }
        }
    }
}
